﻿using System;
using System.Data;
using System.Text;
using System.Collections.Generic;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Data.Sql;
using System.Data.Common;
namespace Chenxin.Lib.Business.DAL
{
    /// <summary>
    /// 数据访问类t_Intention_BillGetedInfo。
    /// </summary>
    public class t_Intention_BillGetedInfo
    {
        public t_Intention_BillGetedInfo()
        { }
        #region  成员方法

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public static void Add(Chenxin.Lib.Business.Entity.t_Intention_BillGetedInfo model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into t_Intention_BillGetedInfo(");
            strSql.Append("BillId,BillCode,InOrOut,IntentionId,IntentionCode,GetedCityId,GetedCity,GetedCompanyId,GetedCompany,GetedDepartId,GetedDepart,GetedEmployeeId,GetedEmployee,AccountType,AccountBank,AccountNum,GetedMoney,GetedTime,bCustody,PayTo,IsConfirmed,ConfirmDate,ConfirmEmployeeId,ConfirmEmployee,IsReview,ReviewDate,ReviewEmployeeId,ReviewEmployee,Addtime,AddEmployeeId,AddEmployee,AddDepartId,AddDepart,UpdateEmployeeId,UpdateEmployee,UpdateTime,Status,DeleteTime,DeleteEmpId,DeleteEmp,DeleteReason,TotalPrintCount,LastPrintTime,LastPrintEmpId,LastPrintEmp)");

            strSql.Append(" values (");
            strSql.Append("@BillId,@BillCode,@InOrOut,@IntentionId,@IntentionCode,@GetedCityId,@GetedCity,@GetedCompanyId,@GetedCompany,@GetedDepartId,@GetedDepart,@GetedEmployeeId,@GetedEmployee,@AccountType,@AccountBank,@AccountNum,@GetedMoney,@GetedTime,@bCustody,@PayTo,@IsConfirmed,@ConfirmDate,@ConfirmEmployeeId,@ConfirmEmployee,@IsReview,@ReviewDate,@ReviewEmployeeId,@ReviewEmployee,@Addtime,@AddEmployeeId,@AddEmployee,@AddDepartId,@AddDepart,@UpdateEmployeeId,@UpdateEmployee,@UpdateTime,@Status,@DeleteTime,@DeleteEmpId,@DeleteEmp,@DeleteReason,@TotalPrintCount,@LastPrintTime,@LastPrintEmpId,@LastPrintEmp)");
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business");
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "BillId", DbType.Guid, model.BillId);
            db.AddInParameter(dbCommand, "BillCode", DbType.AnsiString, model.BillCode);
            db.AddInParameter(dbCommand, "InOrOut", DbType.Int32, model.InOrOut);
            db.AddInParameter(dbCommand, "IntentionId", DbType.Guid, model.IntentionId);
            db.AddInParameter(dbCommand, "IntentionCode", DbType.AnsiString, model.IntentionCode);
            db.AddInParameter(dbCommand, "GetedCityId", DbType.Guid, model.GetedCityId);
            db.AddInParameter(dbCommand, "GetedCity", DbType.AnsiString, model.GetedCity);
            db.AddInParameter(dbCommand, "GetedCompanyId", DbType.Guid, model.GetedCompanyId);
            db.AddInParameter(dbCommand, "GetedCompany", DbType.AnsiString, model.GetedCompany);
            db.AddInParameter(dbCommand, "GetedDepartId", DbType.Guid, model.GetedDepartId);
            db.AddInParameter(dbCommand, "GetedDepart", DbType.AnsiString, model.GetedDepart);
            db.AddInParameter(dbCommand, "GetedEmployeeId", DbType.Guid, model.GetedEmployeeId);
            db.AddInParameter(dbCommand, "GetedEmployee", DbType.AnsiString, model.GetedEmployee);
            db.AddInParameter(dbCommand, "AccountType", DbType.Int32, model.AccountType);
            db.AddInParameter(dbCommand, "AccountBank", DbType.AnsiString, model.AccountBank);
            db.AddInParameter(dbCommand, "AccountNum", DbType.AnsiString, model.AccountNum);
            db.AddInParameter(dbCommand, "GetedMoney", DbType.Decimal, model.GetedMoney);
            db.AddInParameter(dbCommand, "GetedTime", DbType.DateTime, model.GetedTime);
            db.AddInParameter(dbCommand, "bCustody", DbType.Int32, model.bCustody);
            db.AddInParameter(dbCommand, "PayTo", DbType.Int32, model.PayTo);
            db.AddInParameter(dbCommand, "IsConfirmed", DbType.Boolean, model.IsConfirmed);
            db.AddInParameter(dbCommand, "ConfirmDate", DbType.DateTime, model.ConfirmDate);
            db.AddInParameter(dbCommand, "ConfirmEmployeeId", DbType.Guid, model.ConfirmEmployeeId);
            db.AddInParameter(dbCommand, "ConfirmEmployee", DbType.AnsiString, model.ConfirmEmployee);
            db.AddInParameter(dbCommand, "IsReview", DbType.Boolean, model.IsReview);
            db.AddInParameter(dbCommand, "ReviewDate", DbType.DateTime, model.ReviewDate);
            db.AddInParameter(dbCommand, "ReviewEmployeeId", DbType.Guid, model.ReviewEmployeeId);
            db.AddInParameter(dbCommand, "ReviewEmployee", DbType.AnsiString, model.ReviewEmployee);
            db.AddInParameter(dbCommand, "Addtime", DbType.DateTime, model.Addtime);
            db.AddInParameter(dbCommand, "AddEmployeeId", DbType.Guid, model.AddEmployeeId);
            db.AddInParameter(dbCommand, "AddEmployee", DbType.AnsiString, model.AddEmployee);
            db.AddInParameter(dbCommand, "AddDepartId", DbType.Guid, model.AddDepartId);
            db.AddInParameter(dbCommand, "AddDepart", DbType.AnsiString, model.AddDepart);
            db.AddInParameter(dbCommand, "UpdateEmployeeId", DbType.Guid, model.UpdateEmployeeId);
            db.AddInParameter(dbCommand, "UpdateEmployee", DbType.AnsiString, model.UpdateEmployee);
            db.AddInParameter(dbCommand, "UpdateTime", DbType.DateTime, model.UpdateTime);
            db.AddInParameter(dbCommand, "Status", DbType.Int32, model.Status);
            db.AddInParameter(dbCommand, "DeleteTime", DbType.DateTime, model.DeleteTime);
            db.AddInParameter(dbCommand, "DeleteEmpId", DbType.Guid, model.DeleteEmpId);
            db.AddInParameter(dbCommand, "DeleteEmp", DbType.AnsiString, model.DeleteEmp);
            db.AddInParameter(dbCommand, "DeleteReason", DbType.AnsiString, model.DeleteReason);
            db.AddInParameter(dbCommand, "TotalPrintCount", DbType.Int32, model.TotalPrintCount);
            db.AddInParameter(dbCommand, "LastPrintTime", DbType.DateTime, model.LastPrintTime);
            db.AddInParameter(dbCommand, "LastPrintEmpId", DbType.Guid, model.LastPrintEmpId);
            db.AddInParameter(dbCommand, "LastPrintEmp", DbType.AnsiString, model.LastPrintEmp);
            db.ExecuteNonQuery(dbCommand);
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public static void Update(Chenxin.Lib.Business.Entity.t_Intention_BillGetedInfo model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update t_Intention_BillGetedInfo set ");
            strSql.Append("BillCode=@BillCode,");
            strSql.Append("InOrOut=@InOrOut,");
            strSql.Append("IntentionId=@IntentionId,");
            strSql.Append("IntentionCode=@IntentionCode,");
            strSql.Append("GetedCityId=@GetedCityId,");
            strSql.Append("GetedCity=@GetedCity,");
            strSql.Append("GetedCompanyId=@GetedCompanyId,");
            strSql.Append("GetedCompany=@GetedCompany,");
            strSql.Append("GetedDepartId=@GetedDepartId,");
            strSql.Append("GetedDepart=@GetedDepart,");
            strSql.Append("GetedEmployeeId=@GetedEmployeeId,");
            strSql.Append("GetedEmployee=@GetedEmployee,");
            strSql.Append("AccountType=@AccountType,");
            strSql.Append("AccountBank=@AccountBank,");
            strSql.Append("AccountNum=@AccountNum,");
            strSql.Append("GetedMoney=@GetedMoney,");
            strSql.Append("GetedTime=@GetedTime,");
            strSql.Append("bCustody=@bCustody,");
            strSql.Append("PayTo=@PayTo,");
            strSql.Append("IsConfirmed=@IsConfirmed,");
            strSql.Append("ConfirmDate=@ConfirmDate,");
            strSql.Append("ConfirmEmployeeId=@ConfirmEmployeeId,");
            strSql.Append("ConfirmEmployee=@ConfirmEmployee,");
            strSql.Append("IsReview=@IsReview,");
            strSql.Append("ReviewDate=@ReviewDate,");
            strSql.Append("ReviewEmployeeId=@ReviewEmployeeId,");
            strSql.Append("ReviewEmployee=@ReviewEmployee,");
            strSql.Append("Addtime=@Addtime,");
            strSql.Append("AddEmployeeId=@AddEmployeeId,");
            strSql.Append("AddEmployee=@AddEmployee,");
            strSql.Append("AddDepartId=@AddDepartId,");
            strSql.Append("AddDepart=@AddDepart,");
            strSql.Append("UpdateEmployeeId=@UpdateEmployeeId,");
            strSql.Append("UpdateEmployee=@UpdateEmployee,");
            strSql.Append("UpdateTime=@UpdateTime,");
            strSql.Append("Status=@Status,");
            strSql.Append("DeleteTime=@DeleteTime,");
            strSql.Append("DeleteEmpId=@DeleteEmpId,");
            strSql.Append("DeleteEmp=@DeleteEmp,");
            strSql.Append("DeleteReason=@DeleteReason,");
            strSql.Append("TotalPrintCount=@TotalPrintCount,");
            strSql.Append("LastPrintTime=@LastPrintTime,");
            strSql.Append("LastPrintEmpId=@LastPrintEmpId,");
            strSql.Append("LastPrintEmp=@LastPrintEmp");
            strSql.Append(" where BillId=@BillId ");
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business");
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "BillId", DbType.Guid, model.BillId);
            db.AddInParameter(dbCommand, "BillCode", DbType.AnsiString, model.BillCode);
            db.AddInParameter(dbCommand, "InOrOut", DbType.Int32, model.InOrOut);
            db.AddInParameter(dbCommand, "IntentionId", DbType.Guid, model.IntentionId);
            db.AddInParameter(dbCommand, "IntentionCode", DbType.AnsiString, model.IntentionCode);
            db.AddInParameter(dbCommand, "GetedCityId", DbType.Guid, model.GetedCityId);
            db.AddInParameter(dbCommand, "GetedCity", DbType.AnsiString, model.GetedCity);
            db.AddInParameter(dbCommand, "GetedCompanyId", DbType.Guid, model.GetedCompanyId);
            db.AddInParameter(dbCommand, "GetedCompany", DbType.AnsiString, model.GetedCompany);
            db.AddInParameter(dbCommand, "GetedDepartId", DbType.Guid, model.GetedDepartId);
            db.AddInParameter(dbCommand, "GetedDepart", DbType.AnsiString, model.GetedDepart);
            db.AddInParameter(dbCommand, "GetedEmployeeId", DbType.Guid, model.GetedEmployeeId);
            db.AddInParameter(dbCommand, "GetedEmployee", DbType.AnsiString, model.GetedEmployee);
            db.AddInParameter(dbCommand, "AccountType", DbType.Int32, model.AccountType);
            db.AddInParameter(dbCommand, "AccountBank", DbType.AnsiString, model.AccountBank);
            db.AddInParameter(dbCommand, "AccountNum", DbType.AnsiString, model.AccountNum);
            db.AddInParameter(dbCommand, "GetedMoney", DbType.Decimal, model.GetedMoney);
            db.AddInParameter(dbCommand, "GetedTime", DbType.DateTime, model.GetedTime);
            db.AddInParameter(dbCommand, "bCustody", DbType.Int32, model.bCustody);
            db.AddInParameter(dbCommand, "PayTo", DbType.Int32, model.PayTo);
            db.AddInParameter(dbCommand, "IsConfirmed", DbType.Boolean, model.IsConfirmed);
            db.AddInParameter(dbCommand, "ConfirmDate", DbType.DateTime, model.ConfirmDate);
            db.AddInParameter(dbCommand, "ConfirmEmployeeId", DbType.Guid, model.ConfirmEmployeeId);
            db.AddInParameter(dbCommand, "ConfirmEmployee", DbType.AnsiString, model.ConfirmEmployee);
            db.AddInParameter(dbCommand, "IsReview", DbType.Boolean, model.IsReview);
            db.AddInParameter(dbCommand, "ReviewDate", DbType.DateTime, model.ReviewDate);
            db.AddInParameter(dbCommand, "ReviewEmployeeId", DbType.Guid, model.ReviewEmployeeId);
            db.AddInParameter(dbCommand, "ReviewEmployee", DbType.AnsiString, model.ReviewEmployee);
            db.AddInParameter(dbCommand, "Addtime", DbType.DateTime, model.Addtime);
            db.AddInParameter(dbCommand, "AddEmployeeId", DbType.Guid, model.AddEmployeeId);
            db.AddInParameter(dbCommand, "AddEmployee", DbType.AnsiString, model.AddEmployee);
            db.AddInParameter(dbCommand, "AddDepartId", DbType.Guid, model.AddDepartId);
            db.AddInParameter(dbCommand, "AddDepart", DbType.AnsiString, model.AddDepart);
            db.AddInParameter(dbCommand, "UpdateEmployeeId", DbType.Guid, model.UpdateEmployeeId);
            db.AddInParameter(dbCommand, "UpdateEmployee", DbType.AnsiString, model.UpdateEmployee);
            db.AddInParameter(dbCommand, "UpdateTime", DbType.DateTime, model.UpdateTime);
            db.AddInParameter(dbCommand, "Status", DbType.Int32, model.Status);
            db.AddInParameter(dbCommand, "DeleteTime", DbType.DateTime, model.DeleteTime);
            db.AddInParameter(dbCommand, "DeleteEmpId", DbType.Guid, model.DeleteEmpId);
            db.AddInParameter(dbCommand, "DeleteEmp", DbType.AnsiString, model.DeleteEmp);
            db.AddInParameter(dbCommand, "DeleteReason", DbType.AnsiString, model.DeleteReason);
            db.AddInParameter(dbCommand, "TotalPrintCount", DbType.Int32, model.TotalPrintCount);
            db.AddInParameter(dbCommand, "LastPrintTime", DbType.DateTime, model.LastPrintTime);
            db.AddInParameter(dbCommand, "LastPrintEmpId", DbType.Guid, model.LastPrintEmpId);
            db.AddInParameter(dbCommand, "LastPrintEmp", DbType.AnsiString, model.LastPrintEmp);
            db.ExecuteNonQuery(dbCommand);

        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public static void Delete(Guid BillId)
        {

            StringBuilder strSql = new StringBuilder();
            strSql.Append("delete from t_Intention_BillGetedInfo ");
            strSql.Append(" where BillId=@BillId ");
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business");
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "BillId", DbType.Guid, BillId);
            db.ExecuteNonQuery(dbCommand);

        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public static Chenxin.Lib.Business.Entity.t_Intention_BillGetedInfo GetModel(Guid BillId)
        {

            StringBuilder strSql = new StringBuilder();
            strSql.Append("select BillId,BillCode,InOrOut,IntentionId,IntentionCode,GetedCityId,GetedCity,GetedCompanyId,GetedCompany,GetedDepartId,GetedDepart,GetedEmployeeId,GetedEmployee,AccountType,AccountBank,AccountNum,GetedMoney,GetedTime,bCustody,PayTo,IsConfirmed,ConfirmDate,ConfirmEmployeeId,ConfirmEmployee,IsReview,ReviewDate,ReviewEmployeeId,ReviewEmployee,Addtime,AddEmployeeId,AddEmployee,AddDepartId,AddDepart,UpdateEmployeeId,UpdateEmployee,UpdateTime,Status,DeleteTime,DeleteEmpId,DeleteEmp,DeleteReason,TotalPrintCount,LastPrintTime,LastPrintEmpId,LastPrintEmp from t_Intention_BillGetedInfo ");
            strSql.Append(" where BillId=@BillId ");
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business_Search");
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "BillId", DbType.Guid, BillId);
            Chenxin.Lib.Business.Entity.t_Intention_BillGetedInfo model = null;
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                if (dataReader.Read())
                {
                    model = ReaderBind(dataReader);
                }
                dataReader.Close();
                dataReader.Dispose();
            }
            return model;
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public static Chenxin.Lib.Business.Entity.t_Intention_BillGetedInfo GetCode(string strWhere)
        {

            StringBuilder strSql = new StringBuilder();
            strSql.Append("select top 1 BillId,BillCode,InOrOut,IntentionId,IntentionCode,GetedCityId,GetedCity,GetedCompanyId,GetedCompany,GetedDepartId,GetedDepart,GetedEmployeeId,GetedEmployee,AccountType,AccountBank,AccountNum,GetedMoney,GetedTime,bCustody,PayTo,IsConfirmed,ConfirmDate,ConfirmEmployeeId,ConfirmEmployee,IsReview,ReviewDate,ReviewEmployeeId,ReviewEmployee,Addtime,AddEmployeeId,AddEmployee,AddDepartId,AddDepart,UpdateEmployeeId,UpdateEmployee,UpdateTime,Status,DeleteTime,DeleteEmpId,DeleteEmp,DeleteReason,TotalPrintCount,LastPrintTime,LastPrintEmpId,LastPrintEmp ");
            strSql.Append(" FROM t_Intention_BillGetedInfo ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business_Search");
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            Chenxin.Lib.Business.Entity.t_Intention_BillGetedInfo model = null;
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                if (dataReader.Read())
                {
                    model = ReaderBind(dataReader);
                }
                dataReader.Close();
                dataReader.Dispose();
            }
            return model;
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public static DataSet GetList(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select BillId,BillCode,InOrOut,IntentionId,IntentionCode,GetedCityId,GetedCity,GetedCompanyId,GetedCompany,GetedDepartId,GetedDepart,GetedEmployeeId,GetedEmployee,AccountType,AccountBank,AccountNum,GetedMoney,GetedTime,bCustody,PayTo,IsConfirmed,ConfirmDate,ConfirmEmployeeId,ConfirmEmployee,IsReview,ReviewDate,ReviewEmployeeId,ReviewEmployee,Addtime,AddEmployeeId,AddEmployee,AddDepartId,AddDepart,UpdateEmployeeId,UpdateEmployee,UpdateTime,Status,DeleteTime,DeleteEmpId,DeleteEmp,DeleteReason,TotalPrintCount,LastPrintTime,LastPrintEmpId,LastPrintEmp ");
            strSql.Append(" FROM t_Intention_BillGetedInfo ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business_Search");
            return db.ExecuteDataSet(CommandType.Text, strSql.ToString());
        }

        /*
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        {
            Database db = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetStoredProcCommand("UP_GetRecordByPage");
            db.AddInParameter(dbCommand, "tblName", DbType.AnsiString, "t_Intention_BillGetedInfo");
            db.AddInParameter(dbCommand, "fldName", DbType.AnsiString, "ID");
            db.AddInParameter(dbCommand, "PageSize", DbType.Int32, PageSize);
            db.AddInParameter(dbCommand, "PageIndex", DbType.Int32, PageIndex);
            db.AddInParameter(dbCommand, "IsReCount", DbType.Boolean, 0);
            db.AddInParameter(dbCommand, "OrderType", DbType.Boolean, 0);
            db.AddInParameter(dbCommand, "strWhere", DbType.AnsiString, strWhere);
            return db.ExecuteDataSet(dbCommand);
        }*/

        /// <summary>
        /// 获得数据列表（比DataSet效率高，推荐使用）
        /// </summary>
        public static List<Chenxin.Lib.Business.Entity.t_Intention_BillGetedInfo> GetListArray(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select BillId,BillCode,InOrOut,IntentionId,IntentionCode,GetedCityId,GetedCity,GetedCompanyId,GetedCompany,GetedDepartId,GetedDepart,GetedEmployeeId,GetedEmployee,AccountType,AccountBank,AccountNum,GetedMoney,GetedTime,bCustody,PayTo,IsConfirmed,ConfirmDate,ConfirmEmployeeId,ConfirmEmployee,IsReview,ReviewDate,ReviewEmployeeId,ReviewEmployee,Addtime,AddEmployeeId,AddEmployee,AddDepartId,AddDepart,UpdateEmployeeId,UpdateEmployee,UpdateTime,Status,DeleteTime,DeleteEmpId,DeleteEmp,DeleteReason,TotalPrintCount,LastPrintTime,LastPrintEmpId,LastPrintEmp ");
            strSql.Append(" FROM t_Intention_BillGetedInfo ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            List<Chenxin.Lib.Business.Entity.t_Intention_BillGetedInfo> list = new List<Chenxin.Lib.Business.Entity.t_Intention_BillGetedInfo>();
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business_Search");
            using (IDataReader dataReader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
            {
                while (dataReader.Read())
                {
                    list.Add(ReaderBind(dataReader));
                }
                dataReader.Close();
                dataReader.Dispose();
            }
            return list;
        }


        /// <summary>
        /// 对象实体绑定数据
        /// </summary>
        public static Chenxin.Lib.Business.Entity.t_Intention_BillGetedInfo ReaderBind(IDataReader dataReader)
        {
            Chenxin.Lib.Business.Entity.t_Intention_BillGetedInfo model = new Chenxin.Lib.Business.Entity.t_Intention_BillGetedInfo();
            object ojb;
            ojb = dataReader["BillId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.BillId = new Guid(ojb.ToString());
            }
            model.BillCode = dataReader["BillCode"].ToString();
            ojb = dataReader["InOrOut"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.InOrOut = (int)ojb;
            }
            ojb = dataReader["IntentionId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.IntentionId = new Guid(ojb.ToString());
            }
            model.IntentionCode = dataReader["IntentionCode"].ToString();
            ojb = dataReader["GetedCityId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.GetedCityId = new Guid(ojb.ToString());
            }
            model.GetedCity = dataReader["GetedCity"].ToString();
            ojb = dataReader["GetedCompanyId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.GetedCompanyId = new Guid(ojb.ToString());
            }
            model.GetedCompany = dataReader["GetedCompany"].ToString();
            ojb = dataReader["GetedDepartId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.GetedDepartId = new Guid(ojb.ToString());
            }
            model.GetedDepart = dataReader["GetedDepart"].ToString();
            ojb = dataReader["GetedEmployeeId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.GetedEmployeeId = new Guid(ojb.ToString());
            }
            model.GetedEmployee = dataReader["GetedEmployee"].ToString();
            ojb = dataReader["AccountType"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.AccountType = (int)ojb;
            }
            model.AccountBank = dataReader["AccountBank"].ToString();
            model.AccountNum = dataReader["AccountNum"].ToString();
            ojb = dataReader["GetedMoney"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.GetedMoney = (decimal)ojb;
            }
            ojb = dataReader["GetedTime"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.GetedTime = (DateTime)ojb;
            }
            ojb = dataReader["bCustody"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.bCustody = (int)ojb;
            }
            ojb = dataReader["PayTo"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.PayTo = (int)ojb;
            }
            ojb = dataReader["IsConfirmed"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.IsConfirmed = (bool)ojb;
            }
            ojb = dataReader["ConfirmDate"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.ConfirmDate = (DateTime)ojb;
            }
            ojb = dataReader["ConfirmEmployeeId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.ConfirmEmployeeId = new Guid(ojb.ToString());
            }
            model.ConfirmEmployee = dataReader["ConfirmEmployee"].ToString();
            ojb = dataReader["IsReview"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.IsReview = (bool)ojb;
            }
            ojb = dataReader["ReviewDate"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.ReviewDate = (DateTime)ojb;
            }
            ojb = dataReader["ReviewEmployeeId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.ReviewEmployeeId = new Guid(ojb.ToString());
            }
            model.ReviewEmployee = dataReader["ReviewEmployee"].ToString();
            ojb = dataReader["Addtime"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.Addtime = (DateTime)ojb;
            }
            ojb = dataReader["AddEmployeeId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.AddEmployeeId = new Guid(ojb.ToString());
            }
            model.AddEmployee = dataReader["AddEmployee"].ToString();
            ojb = dataReader["AddDepartId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.AddDepartId = new Guid(ojb.ToString());
            }
            model.AddDepart = dataReader["AddDepart"].ToString();
            ojb = dataReader["UpdateEmployeeId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.UpdateEmployeeId = new Guid(ojb.ToString());
            }
            model.UpdateEmployee = dataReader["UpdateEmployee"].ToString();
            ojb = dataReader["UpdateTime"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.UpdateTime = (DateTime)ojb;
            }
            ojb = dataReader["Status"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.Status = (int)ojb;
            }
            ojb = dataReader["DeleteTime"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.DeleteTime = (DateTime)ojb;
            }
            ojb = dataReader["DeleteEmpId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.DeleteEmpId = new Guid(ojb.ToString());
            }
            model.DeleteEmp = dataReader["DeleteEmp"].ToString();
            model.DeleteReason = dataReader["DeleteReason"].ToString();
            ojb = dataReader["TotalPrintCount"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.TotalPrintCount = (int)ojb;
            }
            ojb = dataReader["LastPrintTime"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.LastPrintTime = (DateTime)ojb;
            }
            ojb = dataReader["LastPrintEmpId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.LastPrintEmpId = new Guid(ojb.ToString());
            }
            model.LastPrintEmp = dataReader["LastPrintEmp"].ToString();
            return model;
        }

        #endregion  成员方法
    }
}

